package com.aduerr.v1shouyin.mvp.activity;

import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.aduerr.v1shouyin.R;
import com.aduerr.v1shouyin.common.Constants;

/**
 * @author HI
 * @email dev1024@foxmail.com
 * @time 2019/4/15 16:54
 * @change
 * @chang time
 * @class 扫码预授权
 */

public class PreAuthoActivity extends AppCompatActivity {

    @BindView(R.id.tv_title)
    TextView tvTitle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pre_autho);
        ButterKnife.bind(this);
        tvTitle.setText("扫码预授权");
    }

    @OnClick({R.id.img_back, R.id.rl_complete, R.id.rl_pre, R.id.rl_complete_revoke})
    public void onViewClicked(View view) {
        switch(view.getId()) {
            case R.id.img_back:
                finish();
                break;
            case R.id.rl_complete: //预授权完成
            case R.id.rl_complete_revoke: //预授权撤销，完成撤销
                Intent intent = new Intent(PreAuthoActivity.this, ScanningActivity.class);
                intent.putExtra(Constants.QRCODE_CAPUTER, Constants.PRE_AUTHO_REFUND);
                startActivity(intent);
                break;
            case R.id.rl_pre:
                startActivity(new Intent(PreAuthoActivity.this,
                        PreAuthoReceivActivity.class));
                break;
        }
    }

}
